<%-- 
    Document   : index
    Created on : 2009-3-25, 15:31:04
    Author     : g.huangjx
--%>

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<%
	String sortType = "1";
	if (request.getParameter("sortType") != null
			&& !request.getParameter("sortType").equals("")) {
		sortType = request.getParameter("sortType");
	}
	String type = "";
	if (request.getParameter("type") != null
			&& !request.getParameter("type").equals("")) {
		type = request.getParameter("type");
	}
	String module = "";
	if (request.getParameter("module") != null
			&& !request.getParameter("module").equals("")) {
		module = request.getParameter("module");
	}
	String superId="0";
	if(request.getParameter("superId")!=null&&!request.getParameter("superId").equals("")){
		superId=request.getParameter("superId");
	}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<base target="_self" />
		<title>产品负责人树</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="text/javascript"
			src="<s:url value="/xtreecheckbox/js/xtree.js"/>"></script>

		<link type="text/css" rel="stylesheet"
			href="<s:url value="/xtreecheckbox/xtree.css"/>" />

		<script language="javascript">

function getSel(){
	var myValue= atree.getSelectIds();
	var arr=new Array();
	arr[0]=myValue.id;
	arr[1]=myValue.name;
	window.returnValue=arr;

	window.close();
}
function showPerson(organId){
	alert(organId);
}
function myFunction(organId){
	// window.location.target="content";
	// window.location.href="listPersonTree.action?orgRelaPerson.organization.id="+organId;
     document.all('content').src="listPersonTree.action?orgRelaPerson.organization.id="+organId+"&module=<%=module%>";
}

function delCell(vId,vName){
	var persons=document.getElementById("persons").innerHTML;
	var personNames=document.getElementById("personNames").innerHTML;
	var tr=document.getElementById('personNameTR');
	var td=document.getElementById(vId);
	tr.deleteCell(td.cellIndex);
	document.getElementById("persons").innerHTML=(persons).replace(vId,"");
	document.getElementById("personNames").innerHTML=(personNames).replace(vName,"");
	
}

function sure(){
	/*
	var ids=content.window.document.getElementsByName("ids");
	var names=content.window.document.getElementsByName("names");
	var idstr="";
	var namestr="";
	for(i=0;i<ids.length;i++){
		if(ids[i].checked==true){
			idstr+=ids[i].value+",";
			namestr+=names[i].value+",";
		}
	}*/
	var idstr=""+window.document.getElementById("persons").innerHTML;
	var namestr=""+window.document.getElementById("personNames").innerHTML;
	idstr=idstr.substring(0,idstr.length-1);
	namestr=namestr.substring(0,namestr.length-1);
	if(idstr==""){
		if(!confirm("未选择人员，是否要清空原来的人员?")){
			return;
		}
	}
	var arr=new Array();
	arr[0]=idstr;
	arr[1]=namestr;
	window.returnValue=arr;
	window.close();
}
</script>
	</head>
	<body style="background: #CCCCCC; font-size: 9pt">
		<table>
			<tr>
				<td>
					<button onclick="sure();">
						确定
					</button>
					&nbsp;
					<button onclick="window.close();">
						关闭
					</button>
				</td>
				<td>
					<div id="persons" style="display:none; ">
					</div>
					<div id="personNames" style="display:none; ">
					</div>
					<div id="personDiv">
						<table border="0">
							<tr id="personNameTR">
							</tr>
						</table>
					<div id="persons" style="display:none; ">
				</td>
			</tr>
		</table>
		<div
			style="float: left; width: 50%; height: 500px; border: 0px; overflow-x: hidden; overflow-y: scroll;">
			<script type="text/javascript">
	/// XP Look
	webFXTreeConfig.rootIcon		= "<s:url value="/xtreecheckbox/images/xp/folder.png"/>";
	webFXTreeConfig.openRootIcon	= "<s:url value="/xtreecheckbox/images/xp/openfolder.png"/>";
	webFXTreeConfig.folderIcon		= "<s:url value="/xtreecheckbox/images/xp/folder.png"/>";
	webFXTreeConfig.openFolderIcon	= "<s:url value="/xtreecheckbox/images/xp/openfolder.png"/>";
	webFXTreeConfig.fileIcon		= "<s:url value="/xtreecheckbox/images/xp/file.png"/>";
	webFXTreeConfig.lMinusIcon		= "<s:url value="/xtreecheckbox/images/xp/Lminus.png"/>";
	webFXTreeConfig.lPlusIcon		= "<s:url value="/xtreecheckbox/images/xp/Lplus.png"/>";
	webFXTreeConfig.tMinusIcon		= "<s:url value="/xtreecheckbox/images/xp/Tminus.png"/>";
	webFXTreeConfig.tPlusIcon		= "<s:url value="/xtreecheckbox/images/xp/Tplus.png"/>";
	webFXTreeConfig.iIcon			= "<s:url value="/xtreecheckbox/images/xp/I.png"/>";
	webFXTreeConfig.lIcon			= "<s:url value="/xtreecheckbox/images/xp/L.png"/>";
	webFXTreeConfig.tIcon			= "<s:url value="/xtreecheckbox/images/xp/T.png"/>";
	webFXTreeConfig.blankIcon		= "<s:url value="/xtreecheckbox/images/xp/blank.png"/>";
	var atree = new WebFXLoadTree("组织树","treeOrgan.action?conds.superior=<%=superId%>&type=<%=type%>&module=<%=module%>&date=<%=System.currentTimeMillis()%>");
	document.write(atree);
	</script>
		</div>
		<div
			style="float: right; width: 50%; height: 500px; border: 0px; overflow-x: hidden; overflow-y: hidden;">
			<iframe id="content" src="listPersonTree.action?orgRelaPerson.organization.id=0&module=<%=module%>" name="content" width="100%" height="100%"
				marginheight="0" marginwidth="0"></iframe>
		</div>
	</body>
</html>
